package com.itheima.decorator;

/**
 * @author zzw
 * @date 2025/10/12
 * @description 装饰模式测试类
 */
public class Client {
    public static void main(String[] args) {
        // 点一份炒饭
        FastFood food = new FriedRice();
        // 花费的价格
        System.out.println(food.getDesc() + food.cost() + "元");

        System.out.println("======");

        // 点一份加鸡蛋的炒饭
        FastFood food1 = new FriedRice();
        food1 = new Egg(food1);
        System.out.println(food1.getDesc() + food1.cost() + "元");

        System.out.println("======");

        // 点一份炒面
        FastFood food2 = new FriedNoodles();
        // 花费的价格
        System.out.println(food2.getDesc() + food2.cost() + "元");

        System.out.println("======");

        // 点一份加培根的炒面
        FastFood food3 = new FriedNoodles();
        food3 = new Bacon(food3);
        System.out.println(food3.getDesc() + food3.cost() + "元");
    }
}
